package com.idp.web.shop.service.impl;
import com.idp.web.shop.service.SiteService;
import com.idp.web.shop.dao.SiteDao;
import com.idp.web.shop.entity.Site;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.idp.common.persistence.Page;
import com.idp.common.util.ResourceUtils;

/**
 * 
 * 站点信息service实现类
 * 
 * <pre>
 * 	历史记录：
 * 	2018-04-12 WuJiangWu
 * 	新建文件
 * </pre>
 * 
 * @author 
 * <pre>
 * SD
 * 	WuJiangWu
 * PG
 *	WuJiangWu
 * UT
 *
 * MA
 * </pre>
 * @version $Rev$
 *
 * <p/> $Id$
 *
 */
@Service("siteService")
public class SiteServiceImpl implements SiteService {

	@Resource
	private SiteDao siteDao;
	
	@Override
	public Page<Site> findByPage(Site site, Page<Site> page) {

		page.setResult(siteDao.find(site, page));
		
		return page;
	}
	
	@Override
	public List<Site> findBySearch(Site site) {

		return siteDao.find(site);
	}
	
	@Override
	public Site getById(String id) {

		return siteDao.getById(id);
	}

	@Override
	public void add(Site site) {

		site.setId(ResourceUtils.getUUID());
		siteDao.add(site);
	}
	
	@Override
	public void update(Site site) {

		siteDao.update(site);
	}

	@Override
	public void delete(String id) {

		siteDao.delete(id);
	}
 	
}